package controllers;

import dao.IMovieDao;
import dao.ISeatDao;
import models.User;
import play.Logger;
import play.mvc.Before;
import play.mvc.Controller;
import serviceImpl.SeatDaoImpl;

/**
 * Created by 国彬 on 2016/7/10.
 */
public class SeatAction extends Controller {

    static SeatDaoImpl seatDao = new SeatDaoImpl();
    @Before
    static void checkLogin(){
        renderArgs.put("cxt",request.host);
        if(session.get("user")!=null){
            renderArgs.put("user", User.findById(session.get("user")));
        }
    }
    public static void findSeatByMovieThId(){
        String movieTheatreId = request.params.get("movieTheatreId");
        Logger.info("movieThId: "+movieTheatreId);
        WebService.wsOk(seatDao.findByMovieTheatreId(movieTheatreId));
    }
    
}
